package common.interfaces;

import java.sql.SQLException;

/**
 * Presents data being persisted
 * 
 * @author Gal Lalouche
 */
public interface IPersistent {
	/**
	 * Drops all data from the system and drops the table, and closes the connection to the DB.
	 * 
	 * @return {@code true} iff the table existed before being dropped.
	 * @throws SQLException
	 */
	boolean drop() throws SQLException;
	
	/**
	 * Clears all data from the table (does not drop it)
	 * 
	 * @throws SQLException
	 */
	void clear() throws SQLException;
	
	/**
	 * Drops the table and creates a new one <br>
	 * <b> all data will be removed </b>
	 * 
	 * @throws SQLException
	 */
	void setup() throws SQLException;
	//
	// /**
	// * Sets the current transaction that all changes will take place under.<br>
	// * Existing transactions will <b>not</b> be overwritten.
	// *
	// * @param t The transaction to set
	// * @return <code>true</code> If the transaction was set, <code>false</code> if a transaction was already set and
	// not
	// * committed for this DB.
	// * @throws SQLException
	// */
	// boolean setTransaction(Transaction t) throws SQLException;
}
